<?php

$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();

if($_RQ['op']=='main'){
	$applist=array(
				array('name'=>'core','count'=>cfc('mass')->task_typenum(2),'id'=>'wechat','title'=>'未消费新增用户','desc'=>'近三个月有浏览店铺，但未消费的用户！','icon'=>'fa-weixin','color'=>'#63BE72','action'=>'core/wechat.mass//saletask_type=2','openaction'=>'/index/set/type=2&look=1','btntitle1'=>'查看设置'),
				array('name'=>'core','count'=>cfc('mass')->task_typenum(3),'id'=>'wxapp','title'=>'兴趣人群转化','desc'=>'近7天有下单，但未支付的用户','icon'=>'fa-jsfiddle','color'=>'#63BE72','action'=>'core/wechat.mass//saletask_type=3','openaction'=>'/index/set/type=3&look=1','btntitle1'=>'查看设置'),
				array('name'=>'core','count'=>cfc('mass')->task_typenum(4),'id'=>'ttapp','title'=>'互动粉丝用户','desc'=>'48小时内，与公众号有交互行为','icon'=>'fa-pinterest','color'=>'#FF547B','action'=>'core/wechat.mass//saletask_type=4','openaction'=>'/index/set/type=4&look=1','btntitle1'=>'查看设置'),
				array('name'=>'core','count'=>cfc('mass')->task_typenum(5),'id'=>'aliapp','title'=>'需重点召回客户','desc'=>'历史下单数较高，但90天内未下单','icon'=>'fa-facebook-square','color'=>'#4491F1','action'=>'core/wechat.mass//saletask_type=5','openaction'=>'/index/set/type=5&look=1','btntitle1'=>'查看设置'),
				array('name'=>'core','count'=>cfc('mass')->task_typenum(6),'id'=>'baiduapp','title'=>'需重点发展客户','desc'=>'近30天内都有交易，高于平均','icon'=>'fa-behance-square','color'=>'#7783EA','action'=>'core/wechat.mass//saletask_type=6','openaction'=>'/index/set/type=6&look=1','btntitle1'=>'查看设置'),
				array('name'=>'core','count'=>cfc('mass')->task_typenum(7),'id'=>'qqapp','title'=>'需重点活跃客户','desc'=>'历史下单数较高，但30天未下单','icon'=>'fa-qq','color'=>'#FF4444','action'=>'core/wechat.mass//saletask_type=7','openaction'=>'/index/set/type=7&look=1','btntitle1'=>'查看设置'),
				array('name'=>'core','count'=>cfc('mass')->task_typenum(8),'id'=>'mobile','title'=>'需刺激消费客户','desc'=>'近30天内都有交易，低于平均','icon'=>'fa-mobile','color'=>'#63BE72','action'=>'core/wechat.mass//saletask_type=8','openaction'=>'/index/set/type=8&look=1','btntitle1'=>'查看设置'),
				array('name'=>'core','id'=>'pc','title'=>'自定义人群','desc'=>'根据自身运营情况，创建个性化运营计划','icon'=>'fa-windows','color'=>'#FCC600','action'=>'core/wechat.mass//saletask_type=1','openaction'=>'/index/set/type=1&look=1','btntitle1'=>'查看设置'),
				array('name'=>'core','id'=>'xiu','title'=>'指定手机客户','desc'=>'指定手机精准定位客户','icon'=>'fa-dropbox','color'=>'#C3A769','action'=>'core/wechat.mass//saletask_type=9','openaction'=>'/index/set/type=9&look=1','btntitle1'=>'查看设置'),
	);
	$applist2=array(
				array('name'=>'core','id'=>'wechat','title'=>'会员日营销','desc'=>'特定时间会员专属优惠！提供复购','icon'=>'fa-weixin','color'=>'#63BE72','action'=>'core/wechat.mass//saletask_type=10','openaction'=>'/index/set/type=10&look=1','btntitle1'=>'查看设置'),
				array('name'=>'core','id'=>'wxapp','title'=>'生日营销','desc'=>'会员生日特别活动，提高粘性','icon'=>'fa-jsfiddle','color'=>'#63BE72','action'=>'core/wechat.mass//saletask_type=11','openaction'=>'/index/set/type=11&look=1','btntitle1'=>'查看设置'),
				array('name'=>'core','id'=>'ttapp','title'=>'节日营销','desc'=>'烘托节日气氛，提升运营额','icon'=>'fa-pinterest','color'=>'#FF547B','action'=>'core/wechat.mass//saletask_type=12','openaction'=>'/index/set/type=12&look=1','btntitle1'=>'查看设置'),
				array('name'=>'core','count'=>cfc('mass')->task_typenum(13),'id'=>'aliapp','title'=>'付费会员特价体验','desc'=>'让客户低价体验付费会员权益！','icon'=>'fa-facebook-square','color'=>'#4491F1','action'=>'core/wechat.mass//saletask_type=13','openaction'=>'/index/set/type=13&look=1','btntitle1'=>'查看设置'),
				//array('name'=>'core','id'=>'baiduapp','title'=>'更多场景营销','desc'=>'敬请接待','icon'=>'fa-behance-square','color'=>'#7783EA','action'=>'','openaction'=>'','btntitle1'=>'查看设置'),
	);
	$htmls=array(
				array('type'=>'data','tpltype'=>8,'title'=>'运营计划_Commonly task','datas'=>$applist),
				array('type'=>'data','tpltype'=>8,'title'=>'其他运营_Commonly task','datas'=>$applist2),
	);
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='set'){
	if($_RQ['postdata']){
		$post=get_postdata();
		$type=intval($_RQ['type']);
		if(!$type){
			exi('请先选择要设置的计划！','error');
		}
		$this->plugin_setting('task'.$type,$post);
		exi('操作成功！');
	}
	$type=intval($_RQ['type']);
	if(!$type){
		exi('请先选择要设置的计划！','error');
	}
	$item=$this->plugin_setting('task'.$type);
	$edit=intval($_RQ['look'])?'look':'edit';
	$item['type']=$type;
	$return['item']=$item;
	$return['htmls']=array(
		'type'=>$edit,
		$edit=>array(
			array('type'=>'radio','name'=>'type','title'=>'计划类型','options'=>'types'),
			array('type'=>'radio','name'=>'datatype','title'=>'计划数据','options'=>'datatype'),
			array('type'=>'radio','name'=>'ertype','title'=>'日子类型','options'=>'ertype','show'=>array('datatype'=>3)),
			array('type'=>'select','name'=>'holiday_type','title'=>'节日选择','options'=>'holiday_types','show'=>array('ertype'=>3)),
			array('type'=>'radio','name'=>'timesdays','title'=>'选择天数','options'=>'timesdays','show'=>array('datatype'=>1)),
			array('type'=>'radio','name'=>'isjiaoyu','title'=>'消费情况?','options'=>'jiaoyus','show'=>array('datatype'=>1)),
			array('type'=>'radio','name'=>'jiaoyunums','title'=>'消费频率','options'=>'jiaoyunums','show'=>array('datatype'=>1)),
			array('type'=>'radio','name'=>'fans_type','title'=>'粉丝类型','options'=>'fans_type','show'=>array('datatype'=>2)),
		),
	);
	$return['types']=saletask_types();
	$return['holiday_types']=holiday_types();
	$return['datatype']=array(0=>'无',1=>'订单数据',2=>'粉丝数据',3=>'活动日');
	$return['ertype']=array(0=>'无',1=>'生日',2=>'会员日',3=>'节日');
	$return['jiaoyus']=array('已消费','没订单','有订单未支付');
	$return['timesdays']=array(0=>'默认',7=>'7天内',30=>'30天内',60=>'60天内',90=>'90天内');
	$return['jiaoyunums']=array(0=>'默认',1=>'近期成交高于平均值',2=>'近期成交低于平均值',3=>'历史成交高于平均值',4=>'历史成交低于平均值');
	$return['fans_type']=array('48小时内有交互');
	exi($return);
}
?>